if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */
if (RC ~= 0) then
exit
OPTIONS FAILAT 6 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
/* ------------------------ INSERT YOUR CODE HERE: ------------------- */
'QUERY $LOGNAME VAR=LOGNAME'
if ((LOGNAME = "") | (LOGNAME = "0")) then
call rcs_quicklogin
else do
'SET $LOGNAME ""'
'REQUEST STATUS="Logged off."'
end
/* ---------------------------- END OF YOUR CODE --------------------- */
'UNLOCK' /* VERY important: unlock GUI */
exit
SYNTAX:
SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
'UNLOCK'
exit
/* /// "rcs_login" */
rcs_login: procedure expose CONFIG.
if ((exists("rcs:ci") = 0) | (exists("rcs:co") = 0) | (exists("rcs:rcs") = 0) | (exists("rcs:setuprcs") = 0)) then do
'REQUEST PROBLEM="File(s) missing - Please install and|configure HWRCS before you continue"'
call rcs_exit
end
'QUERY $LOGNAME VAR=LOGNAME'
if (INDEX(LOGNAME, " ") ~= 0) then do
'REQUEST PROBLEM="User name contains invalid character.*nPlease note that the user name should*nbe like a login name (*"bill*") or an*ne-mail address and not like your real*nname."'
LOGNAME = ""
end
if ((LOGNAME = "") | (LOGNAME = "0")) then do
if (VERBOSE = "TRUE") then
'REQUEST PROBLEM="Please log in before you proceed.*nIt is required that every member of your*nworkgroup logs in under a unique name.*nLogin names will be used to keep track of*nthe files used and modified by various*nmembers of your workgroup.*n" BUTTON="!OK"'
else
'REQUEST PROBLEM="Please log in before you proceed."'
call rcs_quicklogin
end
return
/* /// */
/* /// "rcs_quicklogin" */
rcs_quicklogin: procedure expose CONFIG.
'QUERY $LOGNAME VAR=LOGNAME'
if (INDEX(LOGNAME, " ") ~= 0) then do
'REQUEST PROBLEM="User name contains invalid character.*nPlease note that the user name should*nbe like a login name (*"bill*") or an*ne-mail address and not like your real*nname."'
LOGNAME = ""
end
if ((LOGNAME = "") | (LOGNAME = "0")) then do
do while ((LOGNAME = "") | (LOGNAME = "0"))
'REQUEST STRING TITLE="Login" VAR=LOGNAME'
if (RC ~= 0) then do
'UNLOCK'
exit
end
if (INDEX(LOGNAME, " ") ~= 0) then do
'REQUEST PROBLEM="Login name contains invalid character.*nPlease note that the user name should*nbe like a login name (*"bill*") or an*ne-mail address and not like your real*nname."'
LOGNAME = ""
end
else if ((LOGNAME = "") | (LOGNAME = "0")) then
'REQUEST PROBLEM="Anonymous login not supported"'
else do
'SET $LOGNAME "' || LOGNAME || '"'
'REQUEST STATUS="Logged in as ' || LOGNAME || '."'